import glob

import cv2
import numpy as np

bmp_path = "D:\code\git\zxc\project_fubahanxi\Pictures\*.bmp"
bmp_ls = glob.glob(bmp_path)
for ind, i in enumerate(bmp_ls):
    img = cv2.imdecode(np.fromfile(i, dtype=np.uint8), int(cv2.IMREAD_COLOR))
    # img = img[...,::-1]
    cv2.imwrite(f'{ind}.jpg',img)